/**
 * @Author: Wang chunsheng  email:2192138785@qq.com
 * @Date:   2024-02-24 00:32:28
 * @Last Modified by:   Wang chunsheng  email:2192138785@qq.com
 * @Last Modified time: 2024-03-16 20:16:44
 */
import request from '@projectName/utils/request'

export function fetchNewsList(data) {
  return request({
    url: '/officialaccount/news/list',
    method: 'post',
    params: data
  })
}

export function delNewsList(mediaId) {
  return request({
    url: `officialaccount/news/delete-new/${mediaId}`,
    method: 'post'
  })
}

export function newsSynchronous(data) {
  return request({
    url: 'officialaccount/news/synchronous',
    method: 'post',
    data: data
  })
}

export function mediaUpWx(data) {
  return request({
    url: 'officialaccount/news/up-wx',
    method: 'post',
    data: data
  })
}

export function mediaGetCount(data) {
  return request({
    url: 'officialaccount/news/count',
    method: 'post',
    data: data
  })
}

export function mediaInitList(data) {
  return request({
    url: 'officialaccount/media/index',
    method: 'get',
    params: data
  })
}

export function mediaGetView(id) {
  return request({
    url: `officialaccount/media/${id}`,
    method: 'get'
  })
}

export function mediaItemCreate(data) {
  return request({
    url: 'officialaccount/media/create',
    method: 'post',
    data: data
  })
}

export function mediaItemUpdate(id, data) {
  return request({
    url: `officialaccount/media/update/${id}`,
    method: 'put',
    data: data
  })
}

export function mediaItemDelete(id) {
  return request({
    url: `officialaccount/media/delete/${id}`,
    method: 'delete'
  })
}
